
cc.Class({
    extends: cc.Component,

    properties: {
    },

    start () {
        this.addScore  = false;
    },
    setCallFun(cFun){
        this.cFun = cFun;
    },

    update (dt) {
         if(!this.addScore && gGlobal.nodeActor && gGlobal.onGame){
            let boxBird = gGlobal.nodeActor.getBoundingBox();
            let boxScore = this.node.getBoundingBox();
            if(cc.Intersection.rectRect(boxBird,boxScore)){
                if(this.cFun){
                    this.addScore = true;
                    this.cFun();
                }
            }
         }
    },
});
